﻿using UnityEngine;
using System.Collections;

public class HealthBar: MonoBehaviour {

	public Texture2D backgroundTexture;
	public Texture2D foregroundTexture;
	public Texture2D frameTexture;

	public int healthWidth = 210;
	public int healthHeight = 50;
	
	public int healthMarginLeft = 58;
	public int healthMarginTop = 70;
	
	public int frameWidth = 251;
	public int frameHeight = 65;
	
	public int frameMarginLeft = 10;
	public int frameMarginTop = 40;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	void OnGUI () {
		
		//GUI.DrawTexture(new Rect(frameMarginLeft,frameMarginTop, frameMarginLeft + frameWidth, frameMarginTop + frameHeight), backgroundTexture, ScaleMode.ScaleToFit, true, 0 );
		GUI.DrawTexture(new Rect(58,70,210, 50), backgroundTexture, ScaleMode.ScaleAndCrop, true, 0 );
		GUI.DrawTexture(new Rect(healthMarginLeft,healthMarginTop,healthWidth, healthHeight), foregroundTexture, ScaleMode.ScaleAndCrop, true, 0 );
		
		GUI.DrawTexture(new Rect(frameMarginLeft,frameMarginTop, frameMarginLeft + frameWidth,frameMarginTop + frameHeight), frameTexture, ScaleMode.ScaleToFit, true, 0 );
		
	}
}
